# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

_realname=Data-OptList
pkgname=perl-${_realname}
pkgver=0.110
pkgrel=1
pkgdesc="Parse and validate simple name/value option pairs"
arch=('any')
url="https://metacpan.org/release/Data-OptList"
license=('PerlArtistic' 'GPL')
depends=('perl-Params-Util' 'perl-Scalar-List-Utils' 'perl-Sub-Install')
makedepends=('perl-ExtUtils-MakeMaker')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Data-OptList-${pkgver}.tar.gz)
sha512sums=('68393958a38f509a71cfba61f6dff8303821918ba29ad8492af0c23cfd4f741c6ce98c4f68ad295f27e166287fc546229c430816f0bdd6009d4f60860c967b76')

prepare() {
  cd ${_realname}-${pkgver}
}

build() {
  cd ${_realname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 \
  PERL_AUTOINSTALL=--skipdeps \
  PERL5LIB="" \
  MODULEBUILDRC=/dev/null \
  PERL_MM_OPT="INSTALLDIRS=vendor" \
  PERL_MB_OPT="--installdirs vendor" \
  perl Makefile.PL
  make
}

package() {
  cd ${_realname}-${pkgver}
  make install DESTDIR="${pkgdir}"
}
